import 'package:flutter/material.dart';
import 'package:xinxuan/common/appbar_util.dart';
import 'package:get/get.dart';
import 'package:xinxuan/controllers/order_controller/seckill_order_detail_page_controller.dart';
import 'package:xinxuan/utils/color_util.dart';
import 'package:xinxuan/views/my/seckill_order/seckill_order_detail_buyers.dart';
import 'package:xinxuan/views/my/seckill_order/seckill_order_detail_seller.dart';

class SeckillOrderDetailPage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: pageBgColor,
      appBar: AppBarUtil(
        title: '订单详情',
        backgroundColor: pageBgColor,
      ),
      body: GetBuilder<SeckillOrderDetailPageController>(
        init: SeckillOrderDetailPageController(),
        builder: (controller) {
          if (controller.seckillOrderDetailData.value.id! <= 0) {
            return Container();
          }
          if (controller.seckillOrderDetailData.value.orderType == 1) {
            /// 买家
            return SeckillOrderDetailBuyers(controller: controller);
          } else {
            /// 卖家
            return SeckillOrderDetailSeller(controller: controller);
          }
        },
      ),
    );
  }
}